<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title" id="ntModalLabel">{:lang('change_my_password')}</h4>
</div>
<form class="modal-body formbox">
        <div class="row clearfix">
                <div class="col-md-12 column">
                    <div class="alert alert-dismissable alert-info">
                        <button type="button" class="close">×</button>
                        <p></p>
                    </div>
                </div>
            </div>
    <div class="row clearfix">
        <div class="col-md-12">
            <table class="table table-striped table-hover ntTable">
                <tbody>
                <tr>
                    <td>{:lang('current_password')}<span class="required"></span></td>
                    <td><input type="password" class="form-control" name="oldpass" id="oldpass"></td>
                </tr>
                <tr>
                    <td>{:lang('new_password')}<span class="required"></span></td>
                    <td><input type="password" class="form-control" name="newpass" id="newpass"></td>
                </tr>
                <tr>
                    <td>{:lang('confirm_password')}<span class="required"></span></td>
                    <td><input type="password" class="form-control" name="confirm" id="confirm"></td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</form>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:lang('cancel')}
    </button>
    <button type="button" id="quedin" class="btn btn-primary"
            style="padding-left:24px;padding-right:24px">
        <span class="glyphicon glyphicon-floppy-disk"></span>{:lang('save')}
    </button>
</div>
<script>
    //数据的提交
    $('#quedin').click(subfn)
    var addbm = true;
    function subfn() {
        if (addbm) {
            $.ajax({
                url: '/Admin/login/editpass',
                type: 'post',
                data: $(".formbox").serialize(),
                dataType: 'json',
                success: function (res) {
                    if (res.status != 1) {
                        change_mes_type('.modal-body .alert',res.status)
                        $('.modal-body .alert').show()
                        $('.modal-body .alert p').html('*' + res.msg + '<br>')
                        /* toastr.warning(res.msg) */
                    } else {
                        addbm = false
                        change_mes_type('.alert',res.status)
                        $('.alert').show()
                        $('.alert p').html('*' + res.msg + '<br>')
                        $('#repsw_editModal').modal('hide')
                    }
                }
            });
        }
    }
    $(document).keydown(function (event) {
        if (event.keyCode == 13) {
            $('form').each(function () {
                event.preventDefault();
            });
            subfn()
        }
    });
</script>